<%@page import="cn.easybuy.entity.Product_category"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="../statics/css/style.css" />
<script type="text/javascript"
	src="../statics/js/jquery-1.11.1.min_044d0927.js"></script>
<script type="text/javascript"
	src="../statics/js/jquery.bxslider_e88acd1b.js"></script>
<script type="text/javascript" src="../statics/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../statics/js/menu.js"></script>
<script type="text/javascript" src="../statics/js/select.js"></script>
<script type="text/javascript" src="../statics/js/lrscroll.js"></script>
<script type="text/javascript" src="../statics/js/iban.js"></script>
<script type="text/javascript" src="../statics/js/fban.js"></script>
<script type="text/javascript" src="../statics/js/f_ban.js"></script>
<script type="text/javascript" src="../statics/js/mban.js"></script>
<script type="text/javascript" src="../statics/js/bban.js"></script>
<script type="text/javascript" src="../statics/js/hban.js"></script>
<script type="text/javascript" src="../statics/js/tban.js"></script>
<script type="text/javascript" src="../statics/js/lrscroll_1.js"></script>
<title>二组牛逼</title>
</head>
<body>
	<a href="IndexServlet?action=f5">清除缓存</a>
	<!-- 引入头部 -->
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../common/top.jsp"%>
	<!--Begin Menu Begin-->
	<%@include file="../common/Category.jsp"%>
	<!--End Menu End-->
	<div class="i_bg bg_color">
		<div class="i_ban_bg">
			<!--Begin 轮播图开始 Begin-->
			<div class="banner">
				<div class="top_slide_wrap">
					<ul class="slide_box bxslider">
						<li><img src="../statics/images/ban1.jpg" width="740"
							height="401" />
						</li>
						<li><img src="../statics/images/ban1.jpg" width="740"
							height="401" />
						</li>
						<li><img src="../statics/images/ban1.jpg" width="740"
							height="401" />
						</li>
					</ul>
					<div class="op_btns clearfix">
						<a href="#" class="op_btn op_prev"><span></span> </a> <a href="#"
							class="op_btn op_next"><span></span> </a>
					</div>
				</div>
			</div>
			<script type="text/javascript">
				//var jq = jQuery.noConflict();
				(function() {
					$(".bxslider").bxSlider({
						auto : true,
						prevSelector : jq(".top_slide_wrap .op_prev")[0],
						nextSelector : jq(".top_slide_wrap .op_next")[0]
					});
				})();
			</script>
			<!--End 轮播图结束 End-->
			<div class="inews">
				<div class="news_t">
					<span class="fr"><a href="../backend/NewsListServlet">更多
							></a> </span>新闻资讯
				</div>
				<ul>
					<c:forEach items="${sessionScope.newsList}" var="n1"
						varStatus="status">
						<li><span>[ 公告 ]</span><a href="#">${n1.title}</a>
						</li>
					</c:forEach>
				</ul>
			</div>
		</div>
		<!--Begin 热门商品 Begin-->
		<div class="content mar_20">
			<img src="../statics/images/mban_1.jpg" width="1200" height="110" />
		</div>
		<%--一级分类菜单 --%>
		<c:forEach items="${sessionScope.categoryList.get(0)}" var="pc1"
			varStatus="status">
			<div class="i_t mar_10">
				<span class="floor_num">${status.count}F</span> <span class="fl">${pc1.name}</span>
				<span class="i_mores fr"> <c:forEach
						items="${sessionScope.categoryList.get(1)}" var="pc2"
						varStatus="v">
						<c:if test="${pc2.parentId==pc1.id}">
							<a href="#">${pc2.name}</a>&nbsp; &nbsp; | &nbsp; &nbsp; 
		        			</c:if>
					</c:forEach> </span>
			</div>
			<div class="content">
				<div class="fresh_left">
					<div class="fre_ban">
						<div id="imgPlay1">
							<ul class="imgs" id="actor1">
								<li><a href="#"><img src="../statics/images/fre_r.jpg"
										width="211" height="286" /> </a>
								</li>
								<li><a href="#"><img src="../statics/images/fre_r.jpg"
										width="211" height="286" /> </a>
								</li>
								<li><a href="#"><img src="../statics/images/fre_r.jpg"
										width="211" height="286" /> </a>
								</li>
							</ul>
							<div class="prevf">上一张</div>
							<div class="nextf">下一张</div>
						</div>
					</div>
					<div class="fresh_txt">
						<div class="fresh_txt_c">
							<c:forEach items="${sessionScope.categoryList.get(1)}" var="pc2"
								varStatus="v">
								<c:if test="${pc2.parentId==pc1.id}">
									<a href="#">${pc2.name}</a>
								</c:if>
							</c:forEach>
						</div>
					</div>
				</div>
				<div class="fresh_mid">
					<ul>
						<!-- 获取二级分类 -->
						<c:forEach items="${sessionScope.categoryList.get(1)}" var="pc2"
							varStatus="v2">
							<!-- 判断 二级分类的父ID == 一级分类的ID -->
							<c:if test="${pc2.parentId==pc1.id}">
								<!-- 获取三级分类 -->
								<c:forEach items="${sessionScope.categoryList.get(2)}" var="pc3"
									varStatus="v3">
									<!-- 判断 三级分类的父ID == 二级分类的ID -->
									<c:if test="${pc3.parentId==pc2.id}">
										<!-- 获取全部商品 -->
										<c:forEach items="${sessionScope.productList}" var="p"
											varStatus="v">
											<!-- 判断商品是否属于指定分类 -->
											<c:if
												test="${p.categoryLevel1Id==pc1.id&&p.categoryLevel2Id==pc2.id&&p.categoryLevel3Id==pc3.id }">
												<li>
													<div class="name">
														<a href="ProductServlet?action=show&id=${p.id}">${p.name}</a>
													</div>
													<div class="price">
														<font>￥<span>${p.price}</span> </font>
													</div>
													<div class="img">
														<a href="ProductServlet?action=show&id=${p.id}"><img
															src="../statics/productImg/${p.fileName}" width="185"
															height="155" /> </a>
													</div></li>
											</c:if>
										</c:forEach>
									</c:if>
								</c:forEach>
							</c:if>
						</c:forEach>
					</ul>
				</div>
				<div class="fresh_right">
					<ul>
						<li><a href="#"><img src="../statics/images/fre_b1.jpg"
								width="260" height="220" /> </a>
						</li>
						<li><a href="#"><img src="../statics/images/fre_b2.jpg"
								width="260" height="220" /> </a>
						</li>
					</ul>
				</div>
			</div>
		</c:forEach>
		<!--Begin Footer Begin -->
		<%@ include file="../common/footer.jsp"%>
		<!--End Footer End -->
	</div>
</body>
</html>